package top.lfyao.designpattern.details.observer;

public class ObserverClient {
    public static void main(String[] args){
        // 具体主题
        ConcreteSubject concreteSubject = new ConcreteSubject();

        concreteSubject.attach(new ConcreteObserver("X",concreteSubject));
        concreteSubject.attach(new ConcreteObserver("Y",concreteSubject));
        concreteSubject.attach(new ConcreteObserver("Z",concreteSubject));
        concreteSubject.setSubjectState("ABC");
        concreteSubject.notifyObserver();

    }
}
